/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_grupo_cultural")
@NamedQueries({
    @NamedQuery(name = "CexGrupoCultural.findAll", query = "SELECT c FROM CexGrupoCultural c")})
public class CexGrupoCultural implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cgc_id")
    private Integer cgcId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "dcu_nombre")
    private String dcuNombre;
    @Column(name = "cgc_codigo")
    private Integer cgcCodigo;
    @OneToMany(mappedBy = "cexGrupoCultural", fetch = FetchType.LAZY)
    private List<CexHistoriaClinica> cexHistoriaClinicaList;
    @OneToMany(mappedBy = "cexGrupoCultural", fetch = FetchType.LAZY)
    private List<AdmMedico> admMedicoList;

    public CexGrupoCultural() {
    }

    public CexGrupoCultural(Integer cgcId) {
        this.cgcId = cgcId;
    }

    public CexGrupoCultural(Integer cgcId, String dcuNombre) {
        this.cgcId = cgcId;
        this.dcuNombre = dcuNombre;
    }

    public Integer getCgcId() {
        return cgcId;
    }

    public void setCgcId(Integer cgcId) {
        this.cgcId = cgcId;
    }

    public String getDcuNombre() {
        return dcuNombre;
    }

    public void setDcuNombre(String dcuNombre) {
        this.dcuNombre = dcuNombre;
    }

    public Integer getCgcCodigo() {
        return cgcCodigo;
    }

    public void setCgcCodigo(Integer cgcCodigo) {
        this.cgcCodigo = cgcCodigo;
    }

    public List<CexHistoriaClinica> getCexHistoriaClinicaList() {
        return cexHistoriaClinicaList;
    }

    public void setCexHistoriaClinicaList(List<CexHistoriaClinica> cexHistoriaClinicaList) {
        this.cexHistoriaClinicaList = cexHistoriaClinicaList;
    }

    public List<AdmMedico> getAdmMedicoList() {
        return admMedicoList;
    }

    public void setAdmMedicoList(List<AdmMedico> admMedicoList) {
        this.admMedicoList = admMedicoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cgcId != null ? cgcId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexGrupoCultural)) {
            return false;
        }
        CexGrupoCultural other = (CexGrupoCultural) object;
        if ((this.cgcId == null && other.cgcId != null) || (this.cgcId != null && !this.cgcId.equals(other.cgcId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexGrupoCultural[ cgcId=" + cgcId + " ]";
    }
    
}
